MaxSize = 100


class SqQueue:
    def __init__(self) -> None:
        self.data = [None] * MaxSize  # 存放队列中的元素
        self.front = -1  # 队头指针
        self.rear = -1  # 队尾指针

    def empty(self):
        """判断队列是否为空"""
        return self.front == self.rear

    def push(self, e):
        """元素e进队"""
        assert not self.rear == MaxSize-1
        self.rear += 1
        self.data[self.rear] = e

    def pop(self):
        """出队一个元素"""
        assert not self.empty()
        self.front += 1
        return self.data[self.front]

    def gethead(self):
        """取队头元素"""
        assert not self.empty()
        return self.data[self.front+1]
